import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './routes/main/home/home.component';
import {LayoutComponent} from "./layout/layout.component";

const routes: Routes = [
  {
    path: 'home', component: HomeComponent
  },
  {
    path: 'layout', component: LayoutComponent
  },
  {
    path: 'form',
    loadChildren: './routes/form/form.module#FormModule'
  },
  {
    path: 'customers',
    loadChildren: './routes/customers/customers.module#CustomersModule'
  },
  {
    path: 'jsutils',
    loadChildren: './routes/jsutils/jsutils.module#JsutilsModule'
  },
  {
    path: 'orders',
    loadChildren: './routes/orders/orders.module#OrdersModule'
  },
  {
    path: 'webpage-tool',
    loadChildren: './routes/webpage-tool/webpage-tool.module#WebpageToolModule'
  },
  {
    path: 'layout',
    loadChildren: './routes/layout/layout.module#LayoutModule'
  },
  {
    path: '',
    redirectTo: 'webpage-tool',
    pathMatch: 'full'
  }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, {useHash: true}),
    CommonModule
  ],
  exports: [RouterModule],
  declarations: []
})
export class AppRoutingModule {
}
